package com.spring.sunflower.common;

import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.spring.sunflower.R;
import com.spring.sunflower.bean.OnlineStatusBean;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * Created by Kevin on 2021/7/15<br/>
 * <p>
 * Describe:<br/>
 */
public class OnlineStatusAdapter extends BaseQuickAdapter<OnlineStatusBean, BaseViewHolder> {
    public OnlineStatusAdapter(int layoutResId, @Nullable List<OnlineStatusBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, OnlineStatusBean bean) {
        holder.setText(R.id.tvStatus, bean.getName());
        ImageView imageView = holder.getView(R.id.ivTick);
        imageView.setVisibility(bean.isChecked() ? View.VISIBLE : View.INVISIBLE);
    }
}
